// components/plan-card/plan-card.ts
import dayjs from "dayjs"
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    plan:{mode:"交友",name:"",ts:""},
    top:false,
  },

  /**
   * 组件的初始数据
   */
  data: {
    show:true
  },

  /**
   * 组件的方法列表
   */
  methods: {
    handleDelete(){
      this.setData({
        show:false
      })
      this.triggerEvent("delete",this.properties.plan.id) 
    },
    handleDetail(){
      this.triggerEvent("detail",this.properties.plan)
    },
    handleTop(){
      this.triggerEvent("top",!this.properties.top)
    }
  },
  attached:function(){
    this.setData({
      time:dayjs(this.properties.plan.ts).format("HH:mm")
    })
  }
})